package com.sailfish.springbootdemo.controller.db1;

import com.sailfish.springbootdemo.pojo.Result;
import com.sailfish.springbootdemo.service.db1.RoadmapH3cService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/roadmapH3c")
@CrossOrigin
public class RoadmapH3cController {

    @Autowired
    private RoadmapH3cService roadmapH3cService;

    @PostMapping("/updateRoadmapParamByBigType")
    public Result updateRoadmapParamByBigType(@RequestBody String data) {
        return roadmapH3cService.updateRoadmapParamByBigType(data);
    }

    @PostMapping("/updateRoadmapParamByBigTypeNew")
    public Result updateRoadmapParamByBigTypeNew(@RequestBody String data) {
        return roadmapH3cService.updateRoadmapParamByBigTypeNew(data);
    }

    @PostMapping("/getThreeYearsHecParamValue")
    public Result getThreeYearsHecParamValue(Integer versionY, String versionN) {
        return roadmapH3cService.getThreeYearsHecParamValue(versionY, versionN);
    }

    @PostMapping("/exportExcelOfH3CRoadmaps")
    public Result exportExcelOfH3CRoadmaps(Integer year, Integer versionY, String versionN) {
        return roadmapH3cService.exportExcelOfH3CRoadmaps(year, versionY, versionN);
    }

    @PostMapping("/getHistoryVersion")
    public Result getHistoryVersion() {
        return roadmapH3cService.getHistoryVersion();
    }

    @PostMapping("/getMaxHistoryVersionByYear")
    public Result getMaxHistoryVersionByYear(Integer versionY) {
        return roadmapH3cService.getMaxHistoryVersionByYear(versionY);
    }

    @PostMapping("/copyNextVersionH3CRoadmaps")
    public Result copyNextVersionH3CRoadmaps(Integer currentVersionY, String currentVersionN, Integer nextVersionY, String nextVersionN) {
        return roadmapH3cService.copyNextVersionH3CRoadmaps(currentVersionY, currentVersionN, nextVersionY, nextVersionN);
    }

    @PostMapping("/importRoadmapH3cExcel")
    public Result importRoadmapH3cExcel(MultipartFile file) {
        return roadmapH3cService.importRoadmapH3cExcel(file);
    }
}
